package com.eoner.middlelib.router.intercept;

import com.alibaba.android.arouter.facade.Postcard;
import com.alibaba.android.arouter.facade.callback.NavigationCallback;
import com.alibaba.android.arouter.launcher.ARouter;
import com.eoner.middlelib.router.map.FCRouterPath;
/**
 * 文件名：FCBaseIntercept
 * 描 述：base拦截器,拦截掉不存在的页面
 * 作 者：gyq
 * 时 间：2021-1-22
 */
public class FCBaseIntercept implements NavigationCallback {

    @Override
    public void onFound(Postcard postcard) {
        //找到页面
    }

    @Override
    public void onLost(Postcard postcard) {
        //未找到页面
        ARouter.getInstance().build(FCRouterPath.NONE_PATH)
                .with(postcard.getExtras())
                .withString("refPath",postcard.getPath())
                .navigation();
    }

    @Override
    public void onArrival(Postcard postcard) {
        //跳转成功
    }

    @Override
    public void onInterrupt(Postcard postcard) {

    }
}
